package com.bmslz.monitor.base.dto;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.bmslz.monitor.base.util.StringUtils;
import com.bmslz.monitor.base.entity.ProjectAlarm;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @Description: 历史告警查询查询
 * @Author: bobo
 * @Date: 2025-08-10
 * @Version: V1.0
 */
@Data
public class ProjectAlarmSearchDto {

    @ApiModelProperty(value = "项目id")
    private String projectId;


    public LambdaQueryWrapper<ProjectAlarm> wrapper() {
        LambdaQueryWrapper<ProjectAlarm> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(StringUtils.isNotEmpty(projectId), ProjectAlarm::getProjectId, projectId);
        wrapper.orderByDesc(ProjectAlarm::getCreateTime);
        return wrapper;
    }
}
